#!/bin/bash

Current_TIME=`date "+%Y-%m-%d %H:"`
File_TIME=`date "+%Y%m%d"`

#正佳
#z1=`zabbix_get -s 10.64.2.1 -p 10050 -k radius_check_ac["-c %z",/home/radius/radius_iGuangdong/var/log/radius/radacct/121.8.183.252/auth-detail-${File_TIME}] | grep "${Current_TIME}" | wc -l`
#z2=`zabbix_get -s 10.64.2.2 -p 10050 -k radius_check_ac["-c %z",/home/radius/radius_iGuangdong/var/log/radius/radacct/121.8.183.252/auth-detail-${File_TIME}] | grep "${Current_TIME}" | wc -l`


#环讯scg1
#h1=`zabbix_get -s 10.64.2.1 -p 10050 -k radius_check_ac["-c %z",/home/radius/radius_iGuangdong/var/log/radius/radacct/121.10.1.178/auth-detail-${File_TIME}] | grep "${Current_TIME}" | wc -l`
#h2=`zabbix_get -s 10.64.2.2 -p 10050 -k radius_check_ac["-c %z",/home/radius/radius_iGuangdong/var/log/radius/radacct/121.10.1.178/auth-detail-${File_TIME}] | grep "${Current_TIME}" | wc -l`

#环讯scg2
h3=`zabbix_get -s 10.64.2.1 -p 10050 -k radius_check_ac["-c %z",/home/radius/radius_iGuangdong/var/log/radius/radacct/121.10.1.179/auth-detail-${File_TIME}] | grep "${Current_TIME}" | wc -l`
h4=`zabbix_get -s 10.64.2.2 -p 10050 -k radius_check_ac["-c %z",/home/radius/radius_iGuangdong/var/log/radius/radacct/121.10.1.179/auth-detail-${File_TIME}] | grep "${Current_TIME}" | wc -l`

#珠江zm
zj1=`zabbix_get -s 10.64.2.1 -p 10050 -k radius_check_ac["-c %z",/home/radius/radius_iGuangdong/var/log/radius/radacct/125.94.0.254/auth-detail-${File_TIME}] | grep "${Current_TIME}" | wc -l`
zj2=`zabbix_get -s 10.64.2.2 -p 10050 -k radius_check_ac["-c %z",/home/radius/radius_iGuangdong/var/log/radius/radacct/125.94.0.254/auth-detail-${File_TIME}] | grep "${Current_TIME}" | wc -l`


if (( ${h3}==1 || ${h4}==1 )) ; then
	huanxun2=1
else
	huanxun2=0
fi


if (( ${zj1}==1 || ${zj2}==1 )) ; then
	zhujiang=1
else
	zhujiang=0
fi

#echo ${huanxun2}
#echo ${zhujiang}

zabbix_sender -s "IGDMonitor" -z 10.64.2.10 -k HUANXUN2 -o ${huanxun2}
zabbix_sender -s "IGDMonitor" -z 10.64.2.10 -k HUANXUN3 -o ${zhujiang}
